package com.ccut.xunfeiSpringboot.common;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AvatarConfig {

    @Value("${avatar.url}")
    private String avatarUrl;

    @Value("${avatar.apiKey}")
    private String apiKey;

    @Value("${avatar.apiSecret}")
    private String apiSecret;

    @Value("${avatar.appId}")
    private String appId;

    @Value("${avatar.avatarId}")
    private String avatarId;

    @Value("${avatar.vcn}")
    private String vcn;

    @Value("${avatar.avatarId2}")
    private String avatarId2;

    @Value("${avatar.vcn2}")
    private String vcn2;

    @Value("${avatar.avatarId3}")
    private String avatarId3;

    @Value("${avatar.vcn3}")
    private String vcn3;

    // 新增配置项
    @Value("${avatar.avatarId4}")
    private String avatarId4;

    @Value("${avatar.vcn4}")
    private String vcn4;

    @Bean
    public AvatarProperties avatarProperties() {
        return new AvatarProperties(
                avatarUrl,
                apiKey,
                apiSecret,
                appId,
                avatarId,
                vcn,
                avatarId2,
                vcn2,
                avatarId3,
                vcn3,
                avatarId4, // 新增
                vcn4       // 新增
        );
    }

    public record AvatarProperties(
            String avatarUrl,
            String apiKey,
            String apiSecret,
            String appId,
            String avatarId,
            String vcn,
            String avatarId2,
            String vcn2,
            String avatarId3,
            String vcn3,
            String avatarId4, // 新增
            String vcn4       // 新增
    ) {}
}